package com.bestcem.xm.wallet.service;

import com.bestcem.xm.common.core.domain.web.ServiceResult;
import com.bestcem.xm.component.security.dto.TokenDTO;
import com.bestcem.xm.wallet.grpc.client.dto.WalletRechargeDTO;
import com.bestcem.xm.wallet.service.dto.LimitOrderDTO;
import com.bestcem.xm.wallet.service.dto.MiniProgramPayDTO;
import com.bestcem.xm.wallet.service.dto.WalletRechargeInfoDTO;

import java.util.List;

/**
 * 限制充值订单service
 *
 * @author wangyunyun <yunyun.wang@idiaoyan.com>
 * @version v1.0
 * @date 2022/5/13 10:32
 */
public interface LimitOrderService {

    /**
     * 创建限制充值订单
     *
     * @param limitOrderDTO 限制充值订单
     * @return ServiceResult<String>
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @date 2022/5/13 14:40
     */
    ServiceResult<String> insert(LimitOrderDTO limitOrderDTO);

    /**
     * 根据id+公司id更新限制充值订单
     *
     * @param limitOrderDTO 限制充值订单
     * @return ServiceResult<Integer>
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @date 2022/5/13 14:50
     */
    ServiceResult<Integer> updateByIdAndOrgId(LimitOrderDTO limitOrderDTO);

    /**
     * 根据条件更新限制充值订单
     *
     * @param param     更新参数
     * @param condition 更新条件参数
     * @return ServiceResult<Integer>
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @date 2022/5/13 14:55
     */
    ServiceResult<Integer> updateByCondition(LimitOrderDTO param, LimitOrderDTO condition);

    /**
     * 根据id+公司id查询限制充值订单
     *
     * @param orgId        公司id
     * @param limitOrderId 限制充值订单id
     * @return ServiceResult<LimitOrderDTO>
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @date 2022/5/13 14:09
     */
    ServiceResult<LimitOrderDTO> getByIdAndOrgId(String limitOrderId, String orgId);

    /**
     * 根据条件查询限制充值订单
     *
     * @param limitOrderDTO 限制充值订单
     * @return ServiceResult<List < LimitOrderDTO>>
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @date 2022/5/13 14:10
     */
    ServiceResult<List<LimitOrderDTO>> findByCondition(LimitOrderDTO limitOrderDTO);

    /**
     * 钱包余额充值
     *
     * @param walletRechargeDTO 钱包充值dto
     * @param tokenDTO          用户认证信息
     * @return ServiceResult<WalletRechargeInfoDTO>
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @date 2022/5/16 11:12
     */
    ServiceResult<WalletRechargeInfoDTO> rechargeWallet(WalletRechargeDTO walletRechargeDTO, TokenDTO tokenDTO);

    /**
     * 钱包余额充值-小程序 限制充值订单
     *
     * @param limitOrderId 限制充值订单id
     * @param openId       小程序openId
     * @param tokenDTO     用户认证信息
     * @return ServiceResult<LimitOrderDTO>
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @date 2022/5/17 10:21
     */
    ServiceResult<MiniProgramPayDTO> rechargeLimitWallet(String limitOrderId, String openId, TokenDTO tokenDTO);

    /**
     * 通知企业钱包充值订单状态回调接口
     *
     * @param limitOrderDTO 限制充值订单
     * @return ServiceResult<Void>
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @date 2022/5/18 10:26
     */
    ServiceResult<Void> rechargeOrderCallback(LimitOrderDTO limitOrderDTO);
}
